    <!-- Advance table -->
    <script src="<?=$url_styles?>js/plugins/tables/jquery.dataTables.min.js"></script>
    <script src="<?=$url_styles?>js/plugins/tables/colResizable-1.3.min.js"></script>
    <script src="<?=$url_styles?>js/plugins/tables/jquery.tablesorter.min.js"></script> 
    
    <script src="<?=$url_styles?>js/plugins/formselements/jquery.ibutton.min.js"></script>  
    <script src="<?=$url_styles?>js/plugins/formselements/ui.spinner.min.js"></script> 
    <script>
		var page=1;
        function load_table()
        {
            $.ajax({
               url: '<?=url_create('admin','order_p','read')?>',
               dataType: 'json',
               type: 'post',
			   data: {p: page},
               success: function(o)
               {
                   if(o.state=='success'){
                       var str='';
                       for(var i in o.data){
                           var r=o.data[i];
						   var row_class = (o.data[i].name==null || o.data[i].name=='')?'X':'A';
						   if(i%2==1) row_class+=" odd";
						   else row_class+=" even"
                           str+='<tr id="row_'+r.id+'" class="grade'+row_class+'">'+
                                  '<td><a href="'+r.detail_link+
									'" alt=""><image style="max-width:100px;max-height:100px" src="'+r.thumb+
									'" alt="" /><br/>'+r.name+'</a></td>'+
                                  '<td>'+r.amount+'</td>'+
								  '<td>'+r.total_orders+'</td>'+
                              '</tr>';
                       }
					   if(typeof(oTable)!='undefined') oTable.fnDestroy();
                       $('#table tbody').html(str);
					   var p = o.pagination;
					   var pnumbers = p.left?'...':'';
                       for(var i in p.pnumbers){
						   var clas = p.pnumbers[i]==p.curr?'active':'button';
						   pnumbers+='<a data="'+p.pnumbers[i]+'" class="paginate_'+clas+'">'+p.pnumbers[i]+'</a>';
					   }
					   if(p.right) pnumbers+='...';
					   $('#table_paginate span').html(pnumbers);
					   $('#table_previous').attr('data',p.prev);
					   $('#table_next').attr('data',p.next);
					   $('#table_first').attr('data',p.first);
					   $('#table_last').attr('data',p.last);
					   
                   }
               }
            });
        }
		$('#table_paginate a').live('click',function(e){
			var p = $(this).attr('data');
			if(p!=null){
				page=p;
				load_table();
			}
		});
        
        $(document).ready(load_table());
    </script>
    